package com.zhx.aop;

import com.zhx.beanproxy.UserService;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;

/**
 * @author zhx
 * @title
 * @description
 *@date 2022/9/27 14:18
 */
public class MyBeanFactoryAware implements BeanFactoryAware {

    @Override
    public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
        UserService userService = (UserService)beanFactory.getBean("userService");
        System.out.println(  "拿到bean做一些处理"+userService);
    }
}
